{extend name="public/base"}

{block name="title"}修改网站信息配置{/block}

{block name="main"}
<!--添加用户UI-->
<div class="layui-row">
    <div class="layui-col-md4 layui-col-md-offset4">
        <form action="{:url('/lhbs/'.$obj.id)}" method="post" class="layui-form layui-form-pane admin-form">
            <input type="hidden" name="_method" value="put">
            <div class="layui-form-item" >
                <label class="layui-form-label">六合波色</label>
                <div class="layui-input-block">
                    <select name="colour" id="position" class="form-control w-50  col-form-label">
                        <option value="1" {$obj.colour == '蓝波' ? 'selected' : ''}>蓝波</option>
                        <option value="2" {$obj.colour == '绿波' ? 'selected' : ''}>绿波</option>
                        <option value="3" {$obj.colour == '红波' ? 'selected' : ''}>红波</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-form-text" >
                <label for="number" class="layui-form-label">六合数字(每个数字请用,分开)</label>
                <div class="layui-input-block">
                    <textarea name="number" id="number"  placeholder="请输入内容" class="layui-textarea">{$obj.number}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <a href="{:url('/lhbs')}" class="layui-btn layui-btn-normal  layui-btn-sm"><i class="layui-icon layui-icon-left"></i>返回列表</a>
            </div>
                    <input type="hidden" value="{:token()}" name="__token__">
                    <button class="layui-btn layui-btn-success layui-btn-fluid layui-btn-lg">提交修改</button>
        </form>
    </div>
</div>
<script>
    layui.use(['upload','layer','jquery','form'], function(){
        var upload = layui.upload,
            layer = layui.layer,
            $=layui.$;

        //执行实例
        var uploadInst = upload.render({
            elem: '#test1' //绑定元素
            ,url: "{:url('index/upload')}" //上传接口
            ,field:'image'
            ,accept: 'image'
            ,acceptMime:'image/*'
            ,before:function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function(index, file, result){
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
                layer.msg('上传中', {icon: 16, time: 0});
            }
            ,done: function(res){
                //上传完毕回调
                if (res.code===200){
                    layer.msg(res.msg,{
                        icon:1
                    })
                    $('#logo').val(res.path)
                }else{
                    layer.msg(res.msg,{
                        icon:2
                    })
                }
            }
            ,error: function(){
                //请求异常回调
            }
        });
    });
</script>
{/block}